<template>
	<view class="pages pt-20 ">
		<view class="pages-card ">
			<view class="item-box">
				<view class="title fs-lg fc-0 pl-10">
					标签名称
				</view>
				<input class="input-text" placeholder="请输入10个以内的标签名称" type="text" />
			</view>
			<view class="item-box mt-30 ">
				<view class="title fs-lg fc-0 pl-10">
					请选择标签类型
				</view>
				<view class=" type-tag-item p-20 bgc-f4 mb-20" v-for="(item ,index) in typeTagList" :key="index" :class="{
					'ac-type-tag-item':typeTagIndex == index
				}" @click="changeTag(index)">
					<image class="icon-sm" src="/static/images/common/icon-6.png" mode="scaleToFill"></image>
					<view class=" type-tag-title fs-lg mb-10">
						{{item.title}}
					</view>
					<view class=" text fs-sm">
						{{item.text}}
					</view>
				</view>
			</view>
		</view>
		<view class="" v-if="typeTagIndex==0">
			<view class="pl-40" style="line-height: 96rpx;">
				添加标签规则（必须满足已填写的条件）
			</view>
			<view class="pages-card">
				<view class="item-box">
					<view class="title fs-lg fc-0 pl-10">
						下单总数
					</view>
					<input class="input-text" placeholder="用于区分顾客粘性" type="text" />
				</view>
				<view class="item-box">
					<view class="title fs-lg fc-0 pl-10">
						消费总金额（元）
					</view>
					<input class="input-text" placeholder="用于区分顾客消费实力" type="text" />
				</view>
				<view class="item-box">
					<view class="title fs-lg fc-0 pl-10">
						顾客
					</view>
					<input class="input-text" placeholder="每日 8:00 更新" type="text" />
				</view>
			</view>
		</view>

		<view class="" v-if="typeTagIndex==1">
			<view class="row-box pl-30 pr-30" style="height: 96rpx;">
				<view class="">
					顾客
				</view>
				<view class="btn-ac-sm" @click="$fn.toPages('/pages/customer/customerAdd')">
					增加顾客
				</view>
			</view>
			<view class="pages-card" v-if="pagesList.length">
				<view class="flex align-items-center pt-20 pb-20" style="border-bottom: 1rpx solid #EDEDED;"
					v-for="(item,index) in pagesList" :key="index">
					<image class="avatar mr-20" src="/static/images/common/avatar.png" mode="scaleToFill"></image>
					<text class="fw-6 fc-0">微信用户昵称</text>
				</view>
			</view>
			<view class="pages-card" v-else>
				<u-empty mode="data" icon="/static/images/common/no_data.png"></u-empty>
			</view>
		</view>

		<view class="btn-ac" @click="confirm">
			确定
		</view>
		<!-- 技术支持 -->
		<p-support class=""></p-support>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				typeTagIndex: 0,
				pagesList: []
			};
		},
		methods: {
			changeTag(index) {
				this.typeTagIndex = index
			}
		},
		computed: {
			typeTagList() {
				return [{
					title: '手动打标签',
					text: '自主添加顾客，方便随时修改标签。'
				}, {
					title: '手动打标签',
					text: '自主添加顾客，方便随时修改标签。'
				}, ]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pages-card {
		padding: 20rpx;
		margin: 0 auto;
	}

	.bgc-f4 {
		background-color: #F4F4F4;
	}

	.input-text {
		height: 96rpx;
		border-radius: 12rpx;
		overflow: hidden;
		background-color: #F4F4F4;
		padding: 0 20rpx;
	}

	.type-tag-item {
		border-radius: 12rpx;
		border: 1rpx solid #f4f4f4;
		background-color: #F4F4F4;
		position: relative;

		.icon-sm {
			width: 32rpx;
			height: 32rpx;
			position: absolute;
			top: 0;
			right: 0;
			opacity: 0;
		}
	}

	.ac-type-tag-item {
		border: 1rpx solid #00A191;
		background-color: #E8FFFC;

		.type-tag-title {
			color: #00A191;
		}

		.text {
			color: #00A191;
		}

		.icon-sm {
			opacity: 1;
		}
	}

	.title {
		line-height: 96rpx;
	}

	.btn-ac {
		width: 690rpx;
		margin: 80rpx auto 0;
	}

	.avatar {
		width: 72rpx;
		height: 72rpx;
	}
</style>